package cn.itcast.dao;

import cn.itcast.domain.Courier;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

public interface CourierDao extends JpaRepository<Courier,Integer>,JpaSpecificationExecutor{

    @Query("update Courier  set deltag = '1' where id = ?1")
    @Modifying
    @Transactional
    public void updateDelTag(Integer id);




    @Query("update Courier  set deltag = null where id = ?1")
    @Modifying
    @Transactional
    public void updateRestoreTag(Integer id);
}
